package com.example.ibsp_demo.pojo.entity.message;

import java.time.LocalDateTime;

/**
 * 私信会话实体类
 * 对应数据库表 t_session
 */
public class PrivateSession {
    private Integer sessionId;
    private Integer user1Id;
    private Integer user2Id;
    private LocalDateTime createTime;
    private String lastMessage;
    private LocalDateTime lastMessageTime;
    private Integer unreadCount;
    private Integer isRead;

    @Override
    public String toString() {
        return "PrivateSession{" +
                "sessionId=" + sessionId +
                ", user1Id=" + user1Id +
                ", user2Id=" + user2Id +
                ", createTime=" + createTime +
                ", lastMessage='" + lastMessage + '\'' +
                ", lastMessageTime=" + lastMessageTime +
                ", unreadCount=" + unreadCount +
                ", isRead=" + isRead +
                '}';
    }

    public PrivateSession() {
    }

    public PrivateSession(Integer sessionId, Integer user1Id, Integer user2Id, LocalDateTime createTime, String lastMessage, LocalDateTime lastMessageTime, Integer unreadCount, Integer isRead) {
        this.sessionId = sessionId;
        this.user1Id = user1Id;
        this.user2Id = user2Id;
        this.createTime = createTime;
        this.lastMessage = lastMessage;
        this.lastMessageTime = lastMessageTime;
        this.unreadCount = unreadCount;
        this.isRead = isRead;
    }

    public Integer getSessionId() {
        return sessionId;
    }

    public void setSessionId(Integer sessionId) {
        this.sessionId = sessionId;
    }

    public Integer getUser1Id() {
        return user1Id;
    }

    public void setUser1Id(Integer user1Id) {
        this.user1Id = user1Id;
    }

    public Integer getUser2Id() {
        return user2Id;
    }

    public void setUser2Id(Integer user2Id) {
        this.user2Id = user2Id;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getLastMessage() {
        return lastMessage;
    }

    public void setLastMessage(String lastMessage) {
        this.lastMessage = lastMessage;
    }

    public LocalDateTime getLastMessageTime() {
        return lastMessageTime;
    }

    public void setLastMessageTime(LocalDateTime lastMessageTime) {
        this.lastMessageTime = lastMessageTime;
    }

    public Integer getUnreadCount() {
        return unreadCount;
    }

    public void setUnreadCount(Integer unreadCount) {
        this.unreadCount = unreadCount;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }
}
